/*
 * @Description  : 公共路由
 * @Autor        : 杜康
 * @Date         : 2023-02-24 17:26:18 +0800
 * @LastEditors  : 杜康
 * @LastEditTime : 2023-03-16 15:30:14 +0800
 */
// Layout
const Layout = () => import("@/views/layout/Index.vue");
// 401页面
const Err401 = () => import("@/components/Errors/401.vue");
// 404页面
const Err404 = () => import("@/components/Errors/404.vue");

export const commonRouter = [
  { path: "/layout", name: "Layout", component: Layout },
  {
    path: "/errors",
    component: Layout,
    children: [
      {
        name: "401错误页",
        path: "/errors/401",
        component: Err401
      },
      {
        name: "404错误页",
        path: "/errors/404",
        component: Err404
      }
    ]
  },
  {
    path: "/dashboard",
    name: "Dashboard",
    component: Layout,
    children: [
      {
        path: "/dashboard",
        name: "Dashboard",
        component: () => import("@/views/dashboard/Index.vue")
      }
    ]
  },
  {
    path: "/basemodule",
    name: "basemodule",
    component: Layout,
    children: [
      {
        path: "/basemodule/icons",
        name: "icons",
        component: () => import("@/views/basemodule/icons.vue")
      },
      {
        path: "/basemodule/tabs",
        name: "tabs",
        component: () => import("@/views/basemodule/tabs.vue")
      }
    ]
  },
  {
    path: "/datas",
    name: "datas",
    component: Layout,
    children: [
      {
        path: "/datas/tables",
        name: "tables",
        component: () => import("@/views/datas/tables.vue")
      }
    ]
  },
  {
    path: "/forms",
    name: "forms",
    component: Layout,
    children: [
      {
        path: "/forms/form",
        name: "form",
        component: () => import("@/views/forms/form.vue")
      },
      {
        path: "/forms/transfer",
        name: "transfer",
        component: () => import("@/views/forms/transfer.vue")
      }
    ]
  },
  {
    // 未知页面
    name: "Not Fount",
    path: "/:pathMatch(.*)*",
    component: Err404
  }
];
